package crudfx.field;
import javax.swing.border.*;
import javafx.scene.paint.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class ArtPasswordField extends PasswordField{
    public var color:Color=Color.web("#000000") on replace{
        jPasswordField.setForeground(new java.awt.Color(color.red,color.green,color.blue,color.opacity));
        };
    public var selectionColor:Color=Color.web("#000000") on replace{
        jPasswordField.setSelectedTextColor(new java.awt.Color(selectionColor.red
            ,selectionColor.green,selectionColor.blue,selectionColor.opacity));
        };
    public var selectionBackground:Color=Color.web("#000000") on replace{
        jPasswordField.setSelectionColor(new java.awt.Color(selectionBackground.red
            ,selectionBackground.green,selectionBackground.blue,selectionBackground.opacity));
        };
    public-init var bold:Boolean=false;
    public-init var italic:Boolean=false;
    public-init var serifs:Boolean=false;
    public-init var monospaced:Boolean=false;
    public-init var size:Number=9;
    init{
        jPasswordField.setBorder(new EmptyBorder(0,0,0,0));
        jPasswordField.setOpaque(false);
        jPasswordField.setBackground(new java.awt.Color(0,0,0,0));
        jPasswordField.setForeground(new java.awt.Color(color.red,color.green,color.blue,color.opacity));
        jPasswordField.setSelectedTextColor(new java.awt.Color(selectionColor.red
            ,selectionColor.green,selectionColor.blue,selectionColor.opacity));
        jPasswordField.setSelectionColor(new java.awt.Color(selectionBackground.red
            ,selectionBackground.green,selectionBackground.blue,selectionBackground.opacity));
        var fn:String="SansSerif";
        if(monospaced)fn="Monospaced";
        if(serifs)fn="Serif";
        var fst:Integer=0;
        if(bold)fst=fst+java.awt.Font.BOLD;
        if(italic)fst=fst+java.awt.Font.ITALIC;
        var font:java.awt.Font=new java.awt.Font(fn,fst,size);
        jPasswordField.setFont(font);
        }
}
